import { ConfigProvider } from "antd";
import zhCN from "antd/es/locale/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";
import "react-app-polyfill/ie9";
import "react-app-polyfill/stable";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import IETips from "./components/Error/IETips";

import store from "./redux/configStore";
import Routes from "./route/Routes";
console.log(Routes);
import * as serviceWorker from "./serviceWorker";
import myBrowser from "./utils/CheckBroswer.js";
import "react-zmage/lib/zmage.css";
import "./index.css";

import "es5-shim";
import "es5-shim/es5-sham";
import "console-polyfill";
import "core-js";

moment.locale("zh-cn");
// console.log(myBrowser());

if (myBrowser() === "IE") {
  ReactDOM.render(<IETips />, document.getElementById("root"));
} else {
  ReactDOM.render(
    <ConfigProvider locale={zhCN}>
      <Provider store={store}>
        <Routes />
      </Provider>
    </ConfigProvider>,
    document.getElementById("root")
  );
}

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
